#include <func.h>

void *function(void *p)
{
    printf("i am a child\n");
    int *q=(int*)p;
    *q=5;
}

int main()
{
    pthread_t pth;
    int p=10;
    int ret=pthread_create(&pth,NULL,function,&p);
    if(ret!=0)
    {
        printf("pthread failed\n");
        return -1;
    }
    usleep(1);
    printf("i am parent\n");
    printf("%d\n",p);
    return 0;
}